package com.googlecode.yoohoo.xmppcore.protocol.parsing;

import java.util.HashSet;
import java.util.Set;

public class ProtocolRelations {
	private Set<ProtocolRelation> protocolRelations;
	
	public ProtocolRelations() {
		this(null);
	}
	
	public ProtocolRelations(ProtocolRelation[] relations) {
		protocolRelations = new HashSet<ProtocolRelation>();
		if (relations != null) {
			for (ProtocolRelation relation : relations) {
				protocolRelations.add(relation);
			}
		}
	}
	
	public void addProtocolRelation(ProtocolRelation protocolRelation) {
		protocolRelations.add(protocolRelation);
	}
	
	public void removeProtocolRelation(ProtocolRelation protocolRelation) {
		protocolRelations.remove(protocolRelation);
	}
	
	public Set<ProtocolRelation> getProtocolRelations() {
		return protocolRelations;
	}
}
